﻿using ApplicationLibrary.SqlConnector;

namespace Vintner.Masters.ModuleData
{
    #region VI_Customers

    public class VI_Customers : Table
    {
        public static string Name = "VI_Customers";

        public static Column<string> Customer = new Column<string>(Name, "", "Code", LEN.CODE, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);
        public static Column<string> Address = new Column<string>(Name, Properties.Resources.T_Address, "Address", 128);
        public static Column<string> ZipCode = new Column<string>(Name, Properties.Resources.T_ZipCode, "ZipCode", 5);
        public static Column<string> City = new Column<string>(Name, Properties.Resources.T_City, "City", 35);
        public static Column<string> County = new Column<string>(Name, Properties.Resources.T_County, "County", 2);

        public static Column<string> Title = new Column<string>(Name, Properties.Resources.T_Title, "Title", LEN.CODE);
        public static Column<string> Phone1 = new Column<string>(Name, Properties.Resources.T_Phone1, "Phone1", LEN.CODE);
        public static Column<string> Phone2 = new Column<string>(Name, Properties.Resources.T_Phone2, "Phone2", LEN.CODE);
        public static Column<string> Fax = new Column<string>(Name, Properties.Resources.T_Fax, "Fax", LEN.CODE);
        public static Column<string> Refer1 = new Column<string>(Name, Properties.Resources.T_Refer1, "Refer1", LEN.DESCRIPTION);
        public static Column<string> Refer2 = new Column<string>(Name, Properties.Resources.T_Refer2, "Refer2", LEN.DESCRIPTION);
        public static Column<string> Email = new Column<string>(Name, Properties.Resources.T_Email, "Email", LEN.DESCRIPTION);

        public static Column<string> DestGoods1 = new Column<string>(Name, Properties.Resources.T_DestGoods1, "DestGoods1", LEN.BIG_DESCRIPTION);
        public static Column<string> DestGoods2 = new Column<string>(Name, Properties.Resources.T_DestGoods2, "DestGoods2", LEN.BIG_DESCRIPTION);

        public static Column<string> TaxNo = new Column<string>(Name, Properties.Resources.T_TaxNo, "TaxNo", 11);
        public static Column<string> FiscalCode = new Column<string>(Name, Properties.Resources.T_FiscalCode, "FiscalCode", LEN.CODE);

        public static Column<bool> Blocked = new Column<bool>(Name, Properties.Resources.T_Blocked, "Blocked");
        public static Column<bool> Disabled = new Column<bool>(Name, Properties.Resources.T_Disabled, "Disabled");

        public override iColumn ForeignKey
        {
            get { return Customer; }
        }

        public VI_Customers()
        {
            VisibleInRadar(new iColumn[] { Description, Address, Customer });
            Tablename = Name;
            DefineKey(new iColumn[] { Customer });
        }
    }

    #endregion

    #region VI_TaxCode

    public class VI_TaxCode : Table
    {
        public static string Name = "VI_TaxCode";

        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.SHORT_CODE, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.DESCRIPTION);
        public static Column<double> Percent = new Column<double>(Name, "", "Percent");

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public VI_TaxCode()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Code });
        }
    }

    #endregion

    #region VI_Descriptions

    public class VI_Descriptions : Table
    {
        public static string Name = "VI_Descriptions";

        public static Column<DescriptionType> Type = new Column<DescriptionType>(Name, "", "Type", false);
        public static Column<string> Code = new Column<string>(Name, Properties.Resources.T_Code, "Code", LEN.CODE, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return Code; }
        }

        public VI_Descriptions()
        {
            VisibleInRadar(new iColumn[] { Code, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Type, Code });
        }
    }

    #endregion
}